home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Plus 1995 #5 & #6
/
Amiga Plus CD - 1995 - No. 5 and 6.iso
/
pd
/
netz
/
term
/
extras
/
source
/
gtlayout-source.lha
/
LTP_DrawPicker.c
< prev
next >
Wrap
C/C++ Source or Header
|
1995-03-25
|
1KB
|
55 lines
/* GadTools layout toolkit
**
** Copyright © 1993-1995 by Olaf `Olsen' Barthel
** Freely distributable.
*/
#include "gtlayout_global.h"
VOID __regargs
LTP_DrawPicker(struct RastPort *RPort,BOOLEAN UpDirection,LONG Left,LONG Top,LONG Width,LONG Height)
{
LONG i,Len,ArrowHeight,ArrowWidth,LineHeight,Start;
LineHeight = (Height + 15) / 16;
ArrowHeight = Height - (Height + 7) / 8;
ArrowWidth = Width;
if(UpDirection)
{
for(i = 0 ; i < ArrowHeight ; i++)
{
Len = ((ArrowWidth * (i + 1)) / ArrowHeight) & ~1;
if(Len < ArrowWidth)
Len++;
Start = Left + (ArrowWidth - Len) / 2;
Move(RPort,Start,Top + i);
Draw(RPort,Start + Len - 1,Top + i);
}
}
else
{
for(i = 0 ; i < ArrowHeight ; i++)
{
Len = ((ArrowWidth * (i + 1)) / ArrowHeight) & ~1;
if(Len < ArrowWidth)
Len++;
Start = Left + (ArrowWidth - Len) / 2;
Move(RPort,Start,Top + ArrowHeight - 1 - i);
Draw(RPort,Start + Len - 1,Top + ArrowHeight - 1 - i);
}
}
for(i = 0 ; i < LineHeight ; i++)
{
Move(RPort,Left,Top + Height - 1 - i);
Draw(RPort,Left + Width - 1,Top + Height - 1 - i);
}
}